//
//  IndexDataFactory.h
//  Chart
//
//  Created by CaoJun on 13-6-13.
//
//

#ifndef __Chart__IndexDataFactory__
#define __Chart__IndexDataFactory__

//ADDIndex:
#include "IndexData.h"
#include "IndexConfig.h"
#include "MA.h"
#include "BOLLIN.h"
#include "TJ.h"
#include "EconomicCalendar.h"
#include "VOLUME.h"
#include "Tuov.h"
#include "MACD.h"
#include "KDJ.h"
#include "RSI.h"
#include "BIAS.h"
#include "QK.h"
#include "QKT.h"
#include "CCI.h"
#include "GameMatrix.h"
#include "HJJT.h"

#include <map>
#include <numeric>

namespace ytx {
    class IndexDataFactory
    {
    protected:
        //ADDIndex:
        Quotation * data;
        MA * ma;
        BOLLIN * bollin;
        TJ * tj;
        EconomicCalendar * economicCalendar;
        VOLUME * volume;
        Tuov * tuov;
        MACD * macd;
        KDJ * kdj;
        RSI * rsi;
        BIAS * bias;
        QK * qk;
        QKT * qkt;
        CCI * cci;
        GameMatrix * gameMatrix;
        HJJT * hjjt;
        
    public:
        IndexDataFactory(Quotation * data);
        IndexDataFactory();
        virtual ~IndexDataFactory();
        Quotation * getData();
        void setData(Quotation * data);
        void create(const std::map<IndexType::IndexType, IndexConfig> &);
        virtual void factory(const IndexConfig indexConfig) = 0;
        virtual IndexData * getIndexData(IndexConfig indexConfig, bool update=false) = 0;
    };
}

#endif /* defined(__Chart__IndexDataFactory__) */
